Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: some gui questions

2 views
Skip to first unread message

Wolfgang Lux

unread,
Dec 12, 2012, 10:50:50 AM12/12/12
to Sebastian Reitenbach, discuss...@gnu.org
Sebastian Reitenbach wrote:

> for the MPDCon I created an Inspector for the Playlist. There I have some checkboxes.
> I tried to align it in Gorm, but failed a bit do get the text on the left aligned on the grid with the other
> text there. The checkbox itself on the right aligns fine. In the Screenshot you can see that
> the text for the checkboxes is some pixels to the right compared with the other text around them.
> Is this intended, or should it align with the text?

I guess the texts should align. But until this is fixed your only chance is to do the alignment manually (by adding or subtracting a few pixels on the x coordinate in Gorm's size inspector).

> Also, I tried to disable the rating stars, and make the text grey, when the checkboxes are disabled,
> but failed with that. When I disable the top checkbox,I can disable the second checkbox,
> with setEnabled:NO and its getting greyed out, and you cannot click on it.
> But for the Text, and the stars I did not found something working, I also wanted to have the text
> grey the same way like when the checkbox is disabled.

Have you tried setEnabled: NO? This should change the text to grey.

> The Stars are a NSTableView, with a table, containing just one single cell. I tried to set
> the cell setEditable: NO but to no avail.
> Any hint how I can achieve that?

Why do you use a table and not a NSTextField? But anyway, setEnabled should work for a NSTextFieldCell inside a table as well.

Wolfgang


Sebastian Reitenbach

unread,
Dec 12, 2012, 1:53:00 PM12/12/12
to Wolfgang Lux, discuss...@gnu.org
Hi,

On Wednesday, December 12, 2012 16:50 CET, Wolfgang Lux <wolfga...@gmail.com> wrote:

> Sebastian Reitenbach wrote:
>
> > for the MPDCon I created an Inspector for the Playlist. There I have some checkboxes.
> > I tried to align it in Gorm, but failed a bit do get the text on the left aligned on the grid with the other
> > text there. The checkbox itself on the right aligns fine. In the Screenshot you can see that
> > the text for the checkboxes is some pixels to the right compared with the other text around them.
> > Is this intended, or should it align with the text?
>
> I guess the texts should align. But until this is fixed your only chance is to do the alignment manually (by adding or subtracting a few pixels on the x coordinate in Gorm's size inspector).

for the time being, I can live with that, probably should open a bug report for Gorm then, to get it fixed ;)

>
> > Also, I tried to disable the rating stars, and make the text grey, when the checkboxes are disabled,
> > but failed with that. When I disable the top checkbox,I can disable the second checkbox,
> > with setEnabled:NO and its getting greyed out, and you cannot click on it.
> > But for the Text, and the stars I did not found something working, I also wanted to have the text
> > grey the same way like when the checkbox is disabled.
>
> Have you tried setEnabled: NO? This should change the text to grey.

The problem I have with that is, that I don't know how to address the text. In Gorm its just an
NSTextField, but I don't know how to give it a name, and how to address it in the code.


>
> > The Stars are a NSTableView, with a table, containing just one single cell. I tried to set
> > the cell setEditable: NO but to no avail.
> > Any hint how I can achieve that?
>
> Why do you use a table and not a NSTextField? But anyway, setEnabled should work for a NSTextFieldCell inside a table as well.

I also use the same stars in the Playlist. The stars, and the rating, is shamelessly stolen from Grr.

To make them not editable, I tried that:
[minRatingCell setEditable: NO];
[maxRatingCell setEditable: NO];
[minRatingCell setEnabled: NO];
[maxRatingCell setEnabled: NO];

but I still can edit the cells, i.e. change the amount of stars when clicking on them.

The SongRatingCell is a subclass of NSCell:
@interface SongRatingCell : NSCell

Maybe I could use something better?

thanks,
Sebastian

>
> Wolfgang
>






Wolfgang Lux

unread,
Dec 12, 2012, 2:06:51 PM12/12/12
to Sebastian Reitenbach, discuss...@gnu.org
Sebastian Reitenbach wrote:

> Hi,
>
> On Wednesday, December 12, 2012 16:50 CET, Wolfgang Lux <wolfga...@gmail.com> wrote:
>
>> Sebastian Reitenbach wrote:
>>
>>> for the MPDCon I created an Inspector for the Playlist. There I have some checkboxes.
>>> I tried to align it in Gorm, but failed a bit do get the text on the left aligned on the grid with the other
>>> text there. The checkbox itself on the right aligns fine. In the Screenshot you can see that
>>> the text for the checkboxes is some pixels to the right compared with the other text around them.
>>> Is this intended, or should it align with the text?
>>
>> I guess the texts should align. But until this is fixed your only chance is to do the alignment manually (by adding or subtracting a few pixels on the x coordinate in Gorm's size inspector).
>
> for the time being, I can live with that, probably should open a bug report for Gorm then, to get it fixed ;)

I'm not sure this is a Gorm bug. It may as well be a gui bug.

>
>>
>>> Also, I tried to disable the rating stars, and make the text grey, when the checkboxes are disabled,
>>> but failed with that. When I disable the top checkbox,I can disable the second checkbox,
>>> with setEnabled:NO and its getting greyed out, and you cannot click on it.
>>> But for the Text, and the stars I did not found something working, I also wanted to have the text
>>> grey the same way like when the checkbox is disabled.
>>
>> Have you tried setEnabled: NO? This should change the text to grey.
>
> The problem I have with that is, that I don't know how to address the text. In Gorm its just an
> NSTextField, but I don't know how to give it a name, and how to address it in the code.

You should do it in the usual way, i.e., create an outlet for the text field and then connect the text string in Gorm to that outlet.

>>> The Stars are a NSTableView, with a table, containing just one single cell. I tried to set
>>> the cell setEditable: NO but to no avail.
>>> Any hint how I can achieve that?
>>
>> Why do you use a table and not a NSTextField? But anyway, setEnabled should work for a NSTextFieldCell inside a table as well.
>
> I also use the same stars in the Playlist. The stars, and the rating, is shamelessly stolen from Grr.
>
> To make them not editable, I tried that:
> [minRatingCell setEditable: NO];
> [maxRatingCell setEditable: NO];
> [minRatingCell setEnabled: NO];
> [maxRatingCell setEnabled: NO];
>
> but I still can edit the cells, i.e. change the amount of stars when clicking on them.
>
> The SongRatingCell is a subclass of NSCell:
> @interface SongRatingCell : NSCell

Hmmm, I haven't looked at the source, but then I guess it probably ignores the is_disabled and is_editable attributes of the cell.

Wolfgang


Sebastian Reitenbach

unread,
Dec 15, 2012, 11:39:02 AM12/15/12
to Wolfgang Lux, discuss...@gnu.org

On Wednesday, December 12, 2012 20:06 CET, Wolfgang Lux <wolfga...@gmail.com> wrote:

> Sebastian Reitenbach wrote:
>
> > Hi,
> >
> > On Wednesday, December 12, 2012 16:50 CET, Wolfgang Lux <wolfga...@gmail.com> wrote:
> >
> >> Sebastian Reitenbach wrote:
> >>
> >>> for the MPDCon I created an Inspector for the Playlist. There I have some checkboxes.
> >>> I tried to align it in Gorm, but failed a bit do get the text on the left aligned on the grid with the other
> >>> text there. The checkbox itself on the right aligns fine. In the Screenshot you can see that
> >>> the text for the checkboxes is some pixels to the right compared with the other text around them.
> >>> Is this intended, or should it align with the text?
> >>
> >> I guess the texts should align. But until this is fixed your only chance is to do the alignment manually (by adding or subtracting a few pixels on the x coordinate in Gorm's size inspector).
> >
> > for the time being, I can live with that, probably should open a bug report for Gorm then, to get it fixed ;)
>
> I'm not sure this is a Gorm bug. It may as well be a gui bug.

ah, I see.


>
> >
> >>
> >>> Also, I tried to disable the rating stars, and make the text grey, when the checkboxes are disabled,
> >>> but failed with that. When I disable the top checkbox,I can disable the second checkbox,
> >>> with setEnabled:NO and its getting greyed out, and you cannot click on it.
> >>> But for the Text, and the stars I did not found something working, I also wanted to have the text
> >>> grey the same way like when the checkbox is disabled.
> >>
> >> Have you tried setEnabled: NO? This should change the text to grey.
> >
> > The problem I have with that is, that I don't know how to address the text. In Gorm its just an
> > NSTextField, but I don't know how to give it a name, and how to address it in the code.
>
> You should do it in the usual way, i.e., create an outlet for the text field and then connect the text string in Gorm to that outlet.

that worked. Don't know why I did not got to it on my own.

thanks,
Sebastian
0 new messages