GTK newbie: glade app has huge fonts - c

I've got an inherited project that was made with glade. I've managed to get it compiled against gtk+1.2 after debugging some automake and gettext issues. (It's old code that keeps being adapted for similar purposes.) Unfortunately, I have never used GTK before. The code is in C and being developed on CentOS 6.
When compiled, it's supposed to look something like this (a screenshot of an old version I've managed to dig up):
Instead, it looks like this when I compile it on my system:
Ie, all the buttons, windows, and such are present, but it looks like the fonts have gone super-sized. I'm guessing that this is just an issue of pointing the code toward a better set of fonts, but maybe not. Has anyone encountered this sort of thing before? And if so, does anyone have some ideas about where to start looking on how to fix things?
UPDATE:
So I've found in the XML file where the labels are set. For example, the top-left GUNN On button is defined thusly:
<child>
<widget class="GtkToggleButton" id="gunn2_on_tog">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">GUNN On</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">no</property>
<property name="width-request">72</property>
<property name="height-request">24</property>
<property name="visible">yes</property>
<signal name="toggled" handler="on_gunn2_on_tog_toggled" />
</widget>
<packing>
<property name="x">8</property>
<property name="y">16</property>
</packing>
</child>
It seems that I need to do some sort of Pango markup: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html, but I'm still in the process of digging.
UPDATE 2:
I managed to convert the glade file to a version recent enough that the glade installed on the computer would open it. The fonts interface fonts in the glade app look fine. It's not until I compile and run the program that the fonts get out of whack. I've also tried changing my system font preference via the preferences menu to no avail.
UPDATE 3:
I've been able to change the font. Finally. I edited /etc/gtk/gtkrc and added the lines
style "default-text" {
fontset = "-adobe-helvetica-medium-o-normal--10-100-75-75-p-57-iso10646-1,-*-r-*-iso10646-1,*"
}
widget "*" style "default-text"
at the end. It's still not perfect and I don't fully understand it. But progress.

So, finally I was able to find an answer.
As a gtk 1.2 app, the program will eventually respect the system (or local) .gtkrc file.
The long string next to fontset is an X Logical Font Description (wikipedia).
The program xfontsel (provided for CentOS in the xorg-x11-apps yum package) allows one to pick which string they want. My final selection for my gtkrc file is:
style "default-text" {
fontset = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
}
widget "*" style "default-text"
Which gives me the following result:
.
I'm sure that, since the earliest references to GTK+ 1.2.10 start around 2001 this will be a super useful post in the future of Stack Exchange. Hopefully anyone else who has this problem will at least find this useful.
Not every example of this kind of style definition I found on nearly 15-year-old forum posts worked in my gtkrc. I'm guessing it has to do with certain fonts being on my system.

Related

Melt throws “Property without service 'property'”

When building certain mlt files with melt 7.1.0, they run just fine, but when building them with melt 6.24.0, the error message
[producer_xml] Property without service 'property'?
[producer_xml] Property without service 'property'??
appears any number of times. A minimal working example showing this warning precisely twice is the following:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
</mlt>
What is the origin of this error? How can it be fixed?
The documentation is rather sparse on properties and in particular does not seem to mention what it would even mean for a property to have a service. The check for properties without services however is still in the current code (though I have not checked whether the code is dead by now).
Chain services were added in 7.0.0 - they were not supported in 6.24.0 yet.
The XML will not work in 2.24.0 because it uses a chain. You can change "chain" to "producer" to make it work if you do not need to use chain/link features.
Caveat
Before writing this answer, I had not yet gotten around to look at the result. Thus, it stands that no further warnings are given, but with the following approach, only black (and silent) video will be generated.
Old Answer
While I do not understand enough about the internals of the MLT framework to have even an inkling about the origins, I managed to work around this problem by manually reordering the mlt files. In my cases, the error disappeared consistenly when any playlist tag was moved before the first chain tag of the file. In the MWE the error can thus be avoided like this:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
</mlt>

Maven fluido skin always renders left navigation empty on site

I couldn't get the maven-fluido-skin work completely - the left navigation section (the section that contains links to various project details) is always rendered empty. Not sure if I'm missing some skin configuration, but I'd have thought of this functionality to be available to its users out-of-the-box.
Any additional gadgets that I add, like the google search, do appear on the left navigation section though.
Here's how my site descriptor looks:
<project xmlns="http://maven.apache.org/DECORATION/1.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.4.0 http://maven.apache.org/xsd/decoration-1.4.0.xsd"
name="Project name">
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.3.1</version>
</skin>
<custom>
<fluidoSkin>
<profile>pre-release</profile>
<sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
<breadcrumbDivider>»</breadcrumbDivider>
</fluidoSkin>
</custom>
</project>
I use 3.4 version of maven-site-plugin and 1.3.1 version of maven-fluido-skin and 2.2.1 version of maven distribution.
FWIW, the default skin works just fine - it's got the left navigation correct.
You can save some time by using menu references and avoid to specify the item nodes explicitely by using the following menu references which are supported and generated by maven-site-plugin :
<menu ref="parent" />
<menu ref="modules" />
<menu ref="reports"/>
Well, I see why now. Unlike the other skins, fluido expects us to specify all the menus and items explicitly in the site.xml which I didn't do. That's the reason the left nav bar was rendered empty every time.

Could not insert new outlet connection [duplicate]

This question already has answers here:
Xcode 4: Creating a UIView xib, not properly connecting
(33 answers)
Closed 9 years ago.
Could not insert new outlet connection: Could not find any information for the class and not showing any class named "ViewController"
Solutions I have done :
- Restarted XCode
- Restarted System
- Deleted the Deriveddata contents from /Library/developer/xcode
But nothing worked for me
Here is the screenshot for the error
I got the same problem as you today... I think this is a bug of Xcode, below is the way to fix the issue:
Close the project you are working on with.
Delete your project's【DerivedData】folder. (This folder may inside your project's folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you.
restart your project.
After these steps, the problem should be solved. And from my experience, these steps can solve many Xcode problems, so if you got some problem with Xcode again, try these steps first.
Removing(removing reference, not deleting) and then adding the appropriate file(the file of class you want to add the outlet to) is actually enough.
Edit 1 I found that after unchecking (in XCode 6.3.1) I had to wait a few seconds for the Indexing to appear and complete in the project name box. Same for the way backwards. This increased chances to fix the issue in almost all (but not all) cases.
Edit 2
Removing reference means that You do not delete the file completely but just remove it from the project (it still exist in the folder of your project, you add it later).
That's most often a problem of file indexing.
To fix it try to clean your target and if this doesn't work, go to your Derived Datafolder and delete your application there.
This will force xCode to reindex the files
Just got the same issue on Xcode 4.6.2.
Tried solutions presented in different answers/comments, but it still didn't work.
Then all I did was to just:
save all my work;
just quit Xcode & load it again;
then I was able to insert the new outlet connection successfully.
Hope this will save some time/frustration for somebody else.
Personally, I had the same problem: "could not insert new outlet connection" AND when I was starting typing something like "UI..." XCode wasn't doing anything.
I searched for answers, I tried several things... but it was just an unchecked box. When I was creating a new class, XCode unchecked the box linking the class to the project (I guess).
I can't post a screen shot because I don't have 10 reputations but when you create your class, XCode asks you where you want to save it. Down the finder window, you have 'Targets' and two boxes: 'YouProjectName' and 'YouProjectNameTests'. You should check the first one (at least).
Hope this will help. I saw different discussions about the subject.
I recently came across this problem. I soon realized that the cause had been my own doing. I had previously disabled XCode indexing (which used to take forever & eat up my RAM), using the below code in a terminal window:
defaults write com.apple.dt.XCode IDEIndexDisable 1
To revert XCode to its default state, i used the following line in a terminal window:
defaults write com.apple.dt.XCode IDEIndexDisable 0
Voila! All's well again..
If you've imported the Class into your Xcode Project you have to manually add the Class (.m file) to your 'Compile Sources'.
Select project icon > TARGETS > Build Phases > Compile Sources
Click the + button and add your *.m file.
Finally I did it by removing the xcode completely from my mac and reinstall the xocde.dmg file and then install MobileDevice.pkg and MobileDeviceDevelopment.pkg residing on /Applications/Xcode.app/Contents/Resources/Packages
make sure that your source have had been included in the "Build Phases" place.
This do fix my problem. But I think Xcode is still really buggy and annoying.

The tag 'XXX' does not exist in XML namespace 'clr-namespace:YYY'

I have implemented a converter to convert Int32 to String to be able to binding a property to a textBox.
I implement this converter in the namespace MyApp.Converters and it is called Int32ToStringConverter.
Then, in my axml I add the reference to my converter as follow:
<Window x:Class="MusicaDB.Views.PrincipalView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
**xmlns:converter="clr-namesapce:MyApp.Converters, aseembly=MyApp**">
Later, in windows.Resources I have:
<Window.Resources>
<**converter:Int32ToStringConverter** x:Key="Int32ToStringConverter" />
</Window.Resources>
I get the error that the tag Int32ToString converter does not exist in the namespace MyApp.Converters,assembly=MyApp.
I have the project in the local hard drive, in the project properties, the destination .NET is framework 4.0, not framework 4.0 client profile and I try to clear the solution and recompile but the problem persists.
Mainly, this is the two solutions that I always find, but don't resolve my problem.
Three fixes to make here:
No spaces -> xmlns:converter="clr-namesapce:MyApp.Converters,aseembly=MyApp"
No misspellings -> xmlns:converter="clr-namespace:MyApp.Converters,assembly=MyApp"
Right delimiters -> xmlns:converter="clr-namespace:MyApp.Converters;assembly=MyApp"
From the the documentation:
Note that the character separating the clr-namespace token from its value is a colon (:) whereas the character separating the assembly token from its value is an equals sign (=). The character to use between these two tokens is a semicolon. Also, do not include any whitespace anywhere in the declaration.
Another possible solution to this problem is that you're not using the same version of .Net in your project and your library.
I am exploring as to why this is happening, but if your converter is in the main assembly, removing the assembly= from your xmlns:converters tag should remove that build error.
For the record ...
I've face a similar problem and if I removed the ";assembly=X" part from the XAML it worked fine
But don't really understand the reason.
As suggested in this blog:
http://zoomicon.wordpress.com/2012/07/02/fix-the-tag-xxx-does-not-exist-in-xml-namespace-clr-namespaceyyy/#comment-7761
I see two possible causes. The first is that you misspelled "assembly" as "aseembly" in the first starred line. Changing the spelling might be enough. The second possibility is that you haven't added MyApp.dll to your project references, which appear like this
in Visual Studio.
All answers are right. And after trying all of them and you cannot configure why its happening, everything seems alright, Please restart the Visual studio.
That worked for me after wasting almost 1 hour. I found everything ok, but restarted the VS with administration.
use the assemble tag only if it is in another project.
other wise use just namespace tag alone.
For me this fixed the issue
In my situation, I had the same problem with xmlns:local="clr-namespace:<mydefaultnamespace>".
I solved this changing the order of the includes. I put it first and all was solved.
A strange behaviour, but this was my workaround that I found in my situation.
In my case, the assembly which contained the namespace was not physically there.
I checked the references of the assembly that had the build error and looked at the properties of the referenced assembly in question.
I navigated to the path and discovered the assembly was indeed missing (which I realised was my own doing), giving rise to the misleading error.
There is one very obscure case when you get this error - if you're using Microsoft.mshtml.dll and you upgrade to Windows 10 anniversary edition, or as it turns out the Creator edition too.
Even if this isn't what happens to you make sure the library containing the component that cannot be found can be fully compiled. Look in the error list (not the grid but the Output console) for any clues.
In my case I was using Microsoft.mshtml.dll as part of an HTML editor and it was unregistered somehow (in the GAC).
The following article explains with screenshots:
https://techninotes.blogspot.com/2016/08/fixing-cannot-find-wrapper-assembly-for.html#comment-form
In short I had to run a Visual Studio command prompt (as admin) run these commands:
cd C:\Windows\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a
regasm Microsoft.mshtml.dll
I did say obscure :-) The important point is to read the errors that may be buried amongst all your warnings because there might be an important clue.
This can be especially confusing if an Operating system update suddenly breaks your project.
I was temporarily replacing a NuGet dll with a local one when this happened. Turned out the assembly was not the same version as the one I was replacing. I built my assembly with the correct version and it worked.

Adding NAPDEF on Nokia

I am trying to add a new access point on a Nokia S60 device, but I am a little bitt puzzled on how to do it.
According to the spec a node should be added at the following root:
./AP/<X>
Whenever I try to add a node I get a status code 404 meaning that it could not be found. If I try to create an AP that already exists instead I get a status code 418 - it already exists.
The generated xml looks like this:
<Add>
<CmdID>17</CmdID>
<Item>
<Target>
<LocURI>./AP/testAP</LocURI>
</Target>
<Meta>
<Format>node</Format>
<Type>syncml:metinf</Type>
</Meta>
</Item>
</Add>
Using funambol I have also queried the whole ./AP tree and there exists a lot of access point already, all with names like APId00X.
I have tried using other names for my AP on the form APId00X with no luck either.
Does anyone know what it takes to create an AP on a S60 device?
It's not exactly an answer to your question but you might want to run some Symbian C++ code on the device to add the access point, if you can't find a way to do it successfully with OMA-DM.
If that works better, you may still be able to work around the problem by using OMA-DM to install the .sis file containing your code, run it and uninstall it.
It's ugly but there is a higher probability that Nokia actually tests each steps before releasing phones.
Got the answer in a post at Nokia Forum.
When trying to add an access point using a command ./AP/, it will fail with error 404 if some of the mandatory nodes are missing.
So when adding an AP, it works fine as long as you remember to add all mandatory fields.
I'm not sure about which ones are the mandatory fields. I have succefully created an AP without Bearer, but I have not experimented with this.

Resources